home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Games / NeXTmille / Source / StackView.h < prev    next >
Text File  |  1990-12-08  |  2KB  |  56 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. #import "CardHolder.h"
  5. #import    "CardView.h"
  6.  
  7.  
  8. // This class is used for card holders that stack cards.  This
  9. //    includes the draw pile, discard pile, the speed and battle piles, and
  10. //    the distance piles contained in the distance card stacks object. 
  11.  
  12.  
  13. @interface StackView:CardHolder
  14. {
  15.  
  16.                                                 // Normally subviews are stacked on top of each other.
  17.                                                 //    If this flag is set then each subview shows a small amount
  18.                                                 //    of overlap area.
  19.     BOOL    overlapModeFlag;
  20. }
  21.  
  22. + newFrame:( const NXRect * )frameRect;
  23.                                                 // Normally, NO.  In that case card subviews are shown directly on top
  24.                                                 //    of each other (i.e. the lower views are obscured).  YES, allows a
  25.                                                 //    small amount of overlap area to show.  Cards that overlap are
  26.                                                 //    shown on top of the bottom card some small number of units lower
  27.                                                 //    in the window.  The default is NO.
  28. - setOverlap:( BOOL )flag;
  29.                                                 // This method adds a card to the top of the stack.  
  30. - addCard:( CardView * )aCard :sender;
  31.                                                 // This method removes a card from the stack.  If it is the top most
  32.                                                 //    card its subview (usually the next card in the stack) is displayed.
  33. - removeCard:( CardView * )aCard :sender;    
  34.                                                 // This method returns the card on the top of the stack.  It returns nil
  35.                                                 //    if there isn't any cards in the stack.  (The card is not removed
  36.                                                 //    from the stack.)
  37. - ( CardView * )topCard;
  38.                                                 // A private method.  When a card is added or deleted from the stack
  39.                                                 //    the stack is reordered.  If the stack is in overlap mode when a
  40.                                                 //    card is added then the location of the card is adjusted to show
  41.                                                 //    some overlapping area of the cards beneath it.
  42.                                                 // One cute thing about this method, although we'll not be using it, is 
  43.                                                 //    that a card removed from the center of the stack causes the stack
  44.                                                 //    to be reordered.
  45. - _adjustCards;
  46.                                                 // Overrides the superclass methods.  They remove a card(s) from the subview
  47.                                                 //    list and send them to some other object.
  48. - sendCard:( CardView * )aCard to:anObject;
  49. - sendAllCardsTo:anObject;
  50.                                                 // A card is visible if the stack isn't an overlapping stack
  51.                                                 //    and the view isn't the last view.
  52. - ( BOOL )subviewVisible:aView;
  53.  
  54.  
  55. @end
  56.